home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ 2⁄16⁄90 / 0683-Undoable commands-Feb90 < prev    next >
Encoding:
Text File  |  1990-02-16  |  1.7 KB  |  40 lines  |  [TEXT/GEOL]

  1. Item    4977851                         15-Feb-90        11:05PST
  2.  
  3. From:   D5295                           Reseach SW Design, D Goldman,PRT
  4.  
  5. To:     MACAPP.TECH$                    MacApp Technical
  6.  
  7. Sub:    Undoable commands
  8.  
  9. I'm having trouble figuring out how to do something which I'm SURE must be easy
  10. to accomplish. Help!
  11.  
  12. I've got this TControl. If the user clicks in most parts of the control, either
  13. nothing should happen, or else I want to perform a straightforward non-undoable
  14. command. All of that is easy, and works fine. But if the user mouses-up in a
  15. certain part of the control, I want to perform a certain *undoable* command.
  16.  
  17. What needs to happen, somewhere, is a gApplication.CommitLastCommand and then a
  18. gApplication.PerformCommand(myCommand).
  19.  
  20. My problem is that we're performing a TControlTracker command when my TControl.
  21. TrackMouse sees the mouse-up. We need to let TControlTracker.TrackMouse return
  22. gNoChanges, and then somehow tell MacApp to perform my new undoable command.
  23. (Simply having TrackMouse return myCommand won't work.)
  24.  
  25. I thought of having TrackMouse explicitly do the CommitLastCommand and the
  26. PerformCommand, but this doesn't work. PerformCommand does an
  27. UnloadAllSegments, and TControlTracker is apparently in a non-resident segment.
  28. Of course, if this is ALL that is wrong with this approach, I could change the
  29. segment mapping, but I take this obstacle as an indication that I'm not going
  30. about this in the correct way.
  31.  
  32. Bottom line (simple???) question: how do you get a mouse-tracking command
  33. object to create and perform a different command object?
  34.  
  35. -- Perplexed in Portland,
  36.    Dave
  37.  
  38. (Please send/copy your reply directly to me at D5295; I'm not on MacApp.Tech$)
  39.  
  40.